//
//  ZHWebPage.h
//  Pod
//
//  Created by Basic on 16/10/16.
//  Copyright © 2016年 naruto. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <WebKit/WebKit.h>

NS_ASSUME_NONNULL_BEGIN

@interface ZHWebPage : UIViewController
/// url地址
@property (nonatomic, strong, nullable) NSString  *url;
/// 加载的本地html 内容
@property (nonatomic, strong, nullable) NSString  *localHtmlString;
/// 本地的base url
@property (nonatomic, strong, nullable) NSURL *localBaseURL;
/// HTTPHeader
@property (nonatomic, strong, nullable) NSDictionary<NSString*, NSString*> *headers;
/// 自定义 cookies
@property (nonatomic, strong, nullable) NSDictionary<NSString*, NSString*> *cookies;
/// 是否需要固定的导航栏标题，默认 false,即不固定标题，动态读取网页的title
@property (nonatomic, assign) BOOL fixedTitle;
/// 是否隐藏导航栏back，默认 false,即显示导航栏back
@property (nonatomic, assign) BOOL hideBack;
/// 是否隐藏导航栏进度条，默认 false,即显示导航栏进度条
@property (nonatomic, assign) BOOL hideProgress;
/// 是否显示系统ActivityIndicatorView，默认 false,不显示
@property (nonatomic, assign) BOOL showIndicator;
/// 当前页面是否根页面 如果是根页面优先hideBack首页隐藏返回键 默认false
@property (nonatomic, assign) BOOL rootPage;
/// 返回时自动插入关闭item 默认 true
@property (nonatomic, assign) BOOL autoInsertClosed;
/// 显示导航栏
@property (nonatomic, assign) BOOL showNavigationBar;
///webView
@property (nonatomic, strong) WKWebView     *webView;

#pragma mark - 添加js调用oc 的bridge 任务

/**
 准备 交互bridge任务，子类重写，添加自己的任务
 */
- (void)prepareBridges;

///   添加 js 、oc交互bridge
/// @param ObjName 交互的对象名称
/// @param action action description
- (void)addBridgeHandler:(NSString *)ObjName action:(void (^)(id msgBody))action;

#pragma mark - oc 调用js
- (void)evaluateJavaScript:(NSString *)javaScriptString completionHandler:(void (^_Nullable)(id, NSError *_Nullable error))completionHandler;
@end


NS_ASSUME_NONNULL_END
